from itertools import pairwise


class Solution:
    def isSubstringPresent(self, s: str) -> bool:
        return any([a in s for a in set([b + a for a, b in pairwise(s)])])


s = Solution()
print(s.isSubstringPresent("1211"))
